const requestFn = require('../request.js')

const baseUrl = "user/"
const API = {
  addUser :"add",
  deleteUser:"delete",
  queryUser:'get',
  userList:"list/page",
  updateUser:"update"
}

function addUser(data,session){
  return requestFn.request(baseUrl+API.addUser,data,"POST",session)
}
function deleteUser(data,session){
  return requestFn.request(baseUrl+API.deleteUser,data,"POST",session)
}
function queryUser(data,session){
  return requestFn.request(baseUrl+API.updateUser,data,"GET",session)
}
function userList(data,session){
  
  return requestFn.request(baseUrl+API.userList,data,"GET",session)
}
function updateUser(data,session){
  return requestFn.request(baseUrl+API.updateUser,data,"POST",session)
}

module.exports = {
  addUser,
  deleteUser,
  queryUser,
  userList,
  updateUser
}